<template>
  <div>
        <van-field label="姓名" v-model="form.name"/>
        <van-field label="金额" v-model="form.money"/>
        <van-field label="机构名称" v-model="form.company_name"/>
        <el-select :title="客户经理" v-model="form.manager" >
            <el-option  v-for="i in managerlist" :key="i.id" :value="i.id" :label="i.name" >{{i.name}}</el-option>
        </el-select>
        <el-select :title="注册来源"  v-model="form.reffrom" >
            <el-option v-for="i in reffromlist" :key="i.id" :value="i.id" :label="i.name">{{i.name}}</el-option>
        </el-select>
        <van-button @click="addaudit">提交</van-button>
  </div>
</template>

<script>
import myaxios from '../components/http/axios'
// import axios from 'axios'
export default {
    data(){
        return{
            auditlist:[],
            form:{},
            managerlist:[],
            reffromlist:[]
        }
    },
    methods:{
        //提交到审核表中
        addaudit(){
   
            myaxios('addaudit','post',this.form).then(res=>{
                console.log(res);
                alert('添加成功');
            })
        },

        // 客户下拉框
        getmanager(){
            myaxios('getmanager','get').then(res=>{
                this.managerlist = res.list
            })
        },

        // // 注册来源下拉框
        reffrom(){
            myaxios('getreffrom','get').then(res=>{
                this.reffromlist = res.list
            })
        }
        },
    mounted(){
        this.reffrom();
        this.getmanager();
        
    }

}
</script>

<style>

</style>